#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License").  See the NOTICE file
# distributed with this work for additional information regarding copyright
# ownership.  You may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

#
# Copyright (C) 2018 Scylladb, Ltd.
#

list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})

if (CMAKE_CXX_STANDARD)
  set (current_cxx_standard ${CMAKE_CXX_STANDARD})
else ()
  set (current_cxx_standard ${CMAKE_CXX_STANDARD_DEFAULT})
endif ()

if (NOT (current_cxx_standard STREQUAL @CMAKE_CXX_STANDARD@))
  message(WARNING
    "C++ Standard mismatch detected:
- Seastar was compiled with: C++@CMAKE_CXX_STANDARD@
- This project is configured to use: C++${current_cxx_standard}
This mismatch may lead to build failures due to differences in the supported \
features of these two standards. Please adjust your project's C++ standard to \
match Seastar.")
endif ()

if (NOT ((CMAKE_CXX_COMPILER_ID STREQUAL @CMAKE_CXX_COMPILER_ID@) AND
         (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL @CMAKE_CXX_COMPILER_VERSION@)))
  message (WARNING
    "Compiler mismatch detected:
- Seastar was compiled with: @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@ \
- This project is configured to use: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}
This mismatch may lead to build failures due to differences in supported features and ABI compatibility. \
Please configure your project to use the same C++ compiler to match Seastar.")
endif ()

#
# Dependencies.
#

include (SeastarDependencies)
set (Seastar_DPDK @Seastar_DPDK@)
set (Seastar_IO_URING @Seastar_IO_URING@)
set (Seastar_HWLOC @Seastar_HWLOC@)
seastar_find_dependencies ()

if (NOT TARGET Seastar::seastar)
  include ("${CMAKE_CURRENT_LIST_DIR}/SeastarTargets.cmake")
endif ()
